Getting Started with Inmetpy¶

In [49]:
import pandas as pd 
import plotly.express as px 
import plotly.io as pio
pio.renderers.default = "plotly_mimetype+notebook"

from inmetpy.inmet_stations import InmetStation
In [50]:
inmet = InmetStation()

stations = inmet.stations
In [51]:
stations.LATITUDE = stations.LATITUDE.astype(float)
stations.LONGITUDE = stations.LONGITUDE.astype(float)
In [52]:
fig = px.scatter_mapbox(stations, lat="LATITUDE", lon="LONGITUDE", hover_name="STATION_NAME", hover_data=["TP_STATION", "CD_SITUATION"],
                        color = "CD_SITUATION", zoom=3, height=300)
fig.update_layout(mapbox_style="open-street-map")
fig.update_layout(margin={"r":0,"t":0,"l":0,"b":0})
fig.update_layout(height=600, width=500)
fig.show()
In [53]:
import folium


m = folium.Map(location=[45.5236, -122.6750])
In [ ]:
 
In [54]:
from ipyleaflet import Map, LegendControl

m = Map(center=(-10,-45), zoom=4)

legend = LegendControl({"low":"#FAA", "medium":"#A55", "High":"#500"}, name="Legend", position="bottomright")
m.add_control(legend)
In [15]:
m
Map(bottom=2424.4003852599026, center=[-15.318127808439813, -31.88033788983969], controls=(ZoomControl(options…
In [19]:
from bokeh.plotting import figure, output_file, show


p = figure(width=400, height=400)

# add a circle renderer with a size, color, and alpha
p.circle([1, 2, 3, 4, 5], [6, 7, 2, 4, 5], size=20, color="navy", alpha=0.5)

# show the results
p
Out[19]:
Figure(
id = '1405', …)
above = [],
align = 'start',
aspect_ratio = None,
aspect_scale = 1,
background = None,
background_fill_alpha = 1.0,
background_fill_color = '#ffffff',
below = [LinearAxis(id='1414', ...)],
border_fill_alpha = 1.0,
border_fill_color = '#ffffff',
center = [Grid(id='1417', ...), Grid(id='1421', ...)],
css_classes = [],
disabled = False,
extra_x_ranges = {},
extra_x_scales = {},
extra_y_ranges = {},
extra_y_scales = {},
frame_height = None,
frame_width = None,
height = 400,
height_policy = 'auto',
hidpi = True,
inner_height = 0,
inner_width = 0,
js_event_callbacks = {},
js_property_callbacks = {},
left = [LinearAxis(id='1418', ...)],
lod_factor = 10,
lod_interval = 300,
lod_threshold = 2000,
lod_timeout = 500,
margin = (0, 0, 0, 0),
match_aspect = False,
max_height = None,
max_width = None,
min_border = 5,
min_border_bottom = None,
min_border_left = None,
min_border_right = None,
min_border_top = None,
min_height = None,
min_width = None,
name = None,
outer_height = 0,
outer_width = 0,
outline_line_alpha = 1.0,
outline_line_cap = 'butt',
outline_line_color = '#e5e5e5',
outline_line_dash = [],
outline_line_dash_offset = 0,
outline_line_join = 'bevel',
outline_line_width = 1,
output_backend = 'canvas',
renderers = [GlyphRenderer(id='1440', ...)],
reset_policy = 'standard',
right = [],
sizing_mode = None,
subscribed_events = [],
syncable = True,
tags = [],
title = Title(id='1444', ...),
title_location = 'above',
toolbar = Toolbar(id='1429', ...),
toolbar_location = 'right',
toolbar_sticky = True,
visible = True,
width = 400,
width_policy = 'auto',
x_range = DataRange1d(id='1406', ...),
x_scale = LinearScale(id='1410', ...),
y_range = DataRange1d(id='1408', ...),
y_scale = LinearScale(id='1412', ...))
In [ ]: